<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jspgou_sys/head.html"/>
<script type="text/javascript">
var perms = [<#list role.perms as p>"${p}"<#if p_has_next>,</#if></#list>];
function disablePerms() {
	if($("input[name=super]:checked").val()=="true") {
		$(".perm-container input[type=checkbox]").attr("disabled","disabeld");
	} else {
		$(".perm-container input[type=checkbox]").removeAttr("disabled");
	}
}
$(function() {
	disablePerms();
	$("#jvForm").validate();
	$(".perm-container input[type=checkbox]").each(function() {
		var perm = $(this).val();
		var index = perm.indexOf(",");		
		if(index!=-1) {
			perm = perm.substring(0,index);
		}
		for(var i=0,len=perms.length;i<len;i++) {
			if(perms[i]==perm) {
				$(this).attr("checked",true);
				break;
			}
		}
	});
	$("input[name=super]").bind("click",function(){
		disablePerms();
	});
});
</script>
<style type="text/css">
.perm-container{}
.perm-layout-1{padding:3px 0;}
.perm-layout-2{padding-left:30px;}
</style>
</head>
<body>
<div class="body-box">
<div class="rhead">
	<div class="rpos"><@s.m "global.position"/>:  角色管理 - <@s.m "global.edit"/></div>
	<form class="ropt">
		<input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='v_list.do';" class="return-button"/>
	</form>
	<div class="clear"></div>
</div>
<@p.form id="jvForm" action="o_update.do" labelWidth="15">
<@p.text colspan="1" width="50" label="角色名" name="name" value=role.name required="true" class="required" maxlength="100"/>
<@p.text colspan="1" width="50" label="排列顺序" name="priority" value=role.priority required="true" class="required digits" maxlength="5" style="width:70px"/><@p.tr/>
<@p.td colspan="2" label="功能权限"><#assign perms=role.perms/><#include "perms.html"/></@p.td><@p.tr/>
<@p.td colspan="2">
    <@p.hidden name="id" value=role.id/>
    <@p.submit code="global.submit"/> &nbsp; <@p.reset code="global.reset"/></@p.td>
</@p.form>
</div>
</body>
</html>